// import { func } from 'prop-types'
import Loadable from 'react-loadable'
import Loading from '../components/loding.js'
import Login from '../pages/login/Login.jsx'
import AlreadyCancel from '../pages/order/alreadycancel.jsx'
import AlreadyGood from '../pages/order/alreadygood.jsx'
import OrAll from '../pages/order/orall.jsx'
import OrAwaitCargo from '../pages/order/orawaitcargo.jsx'
import OrAwaitMoney from '../pages/order/orawaitmoney.jsx'
import Product from '../pages/product/product.jsx'
function loadable(loadCom) {
    return Loadable({
        loader: loadCom,
        loading: Loading
    })
}
const Home = loadable(() => import('../pages/home/home.js'))
const List = loadable(() => import('../pages/list/com_detail/list.js'))
const ChangeCom = loadable(()=>import("../pages/list/cahngeCom/index.js"))
// 配置详情页
const Detail = loadable(() => import('../pages/list/com_detail/detail.js'))
const Itemdetail = loadable(() => import('../pages/list/com_detail/itemdetail.js'))
// 店铺
// const StoreList = loadable(() => import('../pages/list/store_setail/store_list.js'))
// const StoreRecom = loadable(() => import('../pages/list/store_setail/store_recom.js'))
// const StoreTop = loadable(() => import('../pages/list/store_setail/store_top.js'))
// const StoreWish = loadable(() => import('../pages/list/store_setail/store_wish.js'))
// const StoreAll = loadable(() => import('../pages/list/store_setail/store_all.js'))
const StoreDetail = loadable(() => import('../pages/list/store_setail/store_detail.js'))
// 地图
const Map = loadable(() => import('../components/map/map.js'))

const Order = loadable(() => import('../pages/order/order.js'))
const My = loadable(() => import('../pages/my/my.js'))//我的
const MyMessage = loadable(() => import('../pages/my/my/myMessage.jsx'))//我的信息
const MyConsumption = loadable(() => import('../pages/my/myConsumption/myConsumption'))//消费  足迹
const MyWallet = loadable(() => import('../pages/my/myWallet/myWallet'))//钱包
const MyVip = loadable(() => import('../pages/my/myVIP/myVip'))//充值
const MySet = loadable(() => import('../pages/my/mySet/mySet'))//我的设置
const MySetMessage = loadable(() => import('../components/mySetMessage/mySetMessage'))//修改信息公共组件
const MySetson = loadable(() => import('../pages/my/mySet/mySetson/mySetson'))//设置公共组件
const MySite = loadable(() => import('../pages/my/mySet/mySetson/mySite'))//设置地址  
const MyCollect = loadable(() => import('../pages/my/myCollect/myCollect'))//我的收藏
const MyFootmark = loadable(() => import('../pages/my/myFootmark/myFootmark'))//我的足迹
const MySetSite = loadable(() => import('../pages/my/mySet/mySetson/mySetSite'))//我的地址修改





// 搜索
const Search = loadable(() => import('../components/search/search.js'))

export default [
    { from: '/', to: '/frontcover' },
    { from: '/order', to: '/order/orall' },
    { path: '/frontcover', component: loadable(() => import('../components/frontCover/frontcover.js')), name: '', icon: '', neednav: false },
    // { from: '/storelist', to: '/storelist/all' },
    {
        path: '/home',
        component: Home,
        name: '首页',
        icon: 'iconfont icon-shouye',
        isShow: true,
        neednav: true //需要底部导航
    },
    { path: '/home1', component: loadable(() => import('../pages/home/home_1.js')), name: '会员', ViceRouter: true, icon: 'iconfont icon-shenqingchengweiVIP', neednav: false },
    { path: '/home2', component: loadable(() => import('../pages/home/home_2.js')), name: '门店', ViceRouter: true, icon: 'iconfont icon-mendian1', neednav: false },
    { path: '/home', component: loadable(() => import('../pages/home/home_3.js')), name: '新人', ViceRouter: true, icon: 'iconfont icon-xinren', neednav: false },
    { path: '/home', component: loadable(() => import('../pages/home/home_4.js')), name: '更多', ViceRouter: true, icon: 'iconfont icon-duosefuzhu-gengduotiaojian1', neednav: false },
    { path: '/list', component: ChangeCom, name: '列表', icon: 'iconfont icon-shipin', isShow: true, neednav: true },
    // { path: '/ChangeCom', component: ChangeCom, name: '重写', icon: 'iconfont icon-shipin', isShow: true, neednav: false },
    // {
    //     path: '/storelist', component: StoreList, name: '', icon: '', isShow: true, neednav: false, 
    //     // children: [
    //     //     { path: '/storelist/all', component: StoreAll, isShow: true, neednav: false, biu: true, name: '全部商品' },
    //     //     { path: '/storelist/recom', component: StoreRecom, isShow: true, neednav: false, biu: true, name: '店长推荐' },
    //     //     { path: '/storelist/top', component: StoreTop, isShow: true, neednav: false, biu: true, name: '热榜' },
    //     //     { path: '/storelist/wish', component: StoreWish, isShow: true, neednav: false, biu: true, name: '心愿单' },
    //     // ]
    // },
    {
        path: '/order',
        component: Order,
        name: '订单',
        icon: 'iconfont icon-icon--copy',
        isShow: true,
        neednav: true,
        children: [
            { path: '/order/orall', component: OrAll, isShow: true, biu: true, name: '全部订单', neednav: false },
            { path: '/order/orawaitmoney', component: OrAwaitMoney, isShow: true, biu: true, name: '待付款', neednav: false },
            { path: '/order/orawaitcargo', component: OrAwaitCargo, isShow: true, biu: true, name: '待收货', neednav: false },
            { path: '/order/alreadygood', component: AlreadyGood, isShow: true, biu: true, name: '已完成', neednav: false },
            { path: '/order/alreadycancel', component: AlreadyCancel, isShow: true, biu: true, name: '已取消', neednav: false },
        ]
    },
    { path: '/my', component: My, name: '我的', icon: 'iconfont icon-wode3', isShow: true, neednav: true },
    { path: '/myMessage', component: MyMessage, name: '', icon: '', isShow: false, neednav: false },
    { path: '/myConsumption', component: MyConsumption, name: '', icon: '', isShow: false, neednav: false },
    { path: '/myVip', component: MyVip, name: '', icon: '', isShow: false, neednav: false },
    { path: '/myWallet', component: MyWallet, name: '', icon: '', isShow: false, neednav: false },
    { path: '/mySet', component: MySet, name: '', icon: '', isShow: false, neednav: false },
    { path: '/settle', component: loadable(() => import('../pages/list/settle/settle_accounts.js')), name: '', icon: '', isShow: false, neednav: false },
    { path: '/mySetMessage', component: MySetMessage, name: '', icon: '', isShow: false, neednav: false },
    { path: '/mySetson', component: MySetson, name: '', icon: '', isShow: false, neednav: false },
    { path: '/mySite', component: MySite, name: '', icon: '', isShow: false, neednav: false },
    { path: '/myCollect', component: MyCollect, name: '', icon: '', isShow: false, neednav: false },
    { path: '/myFootmark', component: MyFootmark, name: '', icon: '', isShow: false, neednav: false },
    { path: '/mySetSite', component: MySetSite, name: '', icon: '', isShow: false, neednav: false },



    { path: '/detail', component: Detail, name: '', icon: '', isShow: false, neednav: false },
    { path: '/itemdetail', component: Itemdetail, name: '', icon: '', isShow: false, neednav: false },
    { path: '/search', component: Search, name: '', icon: '', isShow: false, neednav: false },
    { path: '/store_detail', component: StoreDetail, name: '', icon: '', isShow: false, neednav: false },
    { path: '/map', component: Map, name: '', icon: '', isShow: false, neednav: false },
    {
        path: '/login',
        component: Login,
        neednav: false
        //判断是否在底部导航显示
        // isShow:false
    },
    { path: '/product', component: Product, neednav: false },

]